#ifndef KEYBINDINGS_H
#define KEYBINDINGS_H

#include <allegro5/allegro5.h>
#include <string>
#include <map>

class KeyBindings {
public:
     enum KeyAction {
	  NoAction,
	  // notes
	  NoteC0,
	  NoteCS0,
	  NoteD0,
	  NoteDS0,
	  NoteE0,
	  NoteF0,
	  NoteFS0,
	  NoteG0,
	  NoteGS0,
	  NoteA0,
	  NoteAS0,
	  NoteB0,
	  NoteC1,
	  NoteCS1,
	  NoteD1,
	  NoteDS1,
	  NoteE1,
	  NoteF1,
	  NoteFS1,
	  NoteG1,
	  NoteGS1,
	  NoteA1,
	  NoteAS1,
	  NoteB1,
	  NoteOff,
	  // cursor movement
	  RowUp,
	  RowDown,
	  FieldUp,
	  FieldDown,
	  ColUp,
	  ColDown,
          EventType,
	  // misc
	  Delete,
	  TogglePlay
     };
     static const int NO_KEY;

     KeyBindings();
     ~KeyBindings();
     void init(ALLEGRO_CONFIG *pConfig);
     int keyAction(int key, int modifiers);
     static bool keyIsHex(int key);
     static int hexKeyInt(int key);

private:
     std::map<int, int> m_bindings;

     void setDefaults();
     int strToKey(std::string &keyStr);
     int strToAction(std::string &actionStr);
};

#endif
